<!DOCTYPE html>
<html>
<head>
    <title>Time over WebSocket</title>
    <script src="http://localhost:8080/sockjs.js"></script>
    <script type="text/javascript">

        var sock = new SockJS('http://localhost:8080/time');
        sock.onopen = function () {
            document.getElementById('time').innerHTML = 'Connecting...';
        };
        sock.onmessage = function (e) {
            document.getElementById('time').innerHTML = e.data;
        };
        sock.onclose = function () {
            document.getElementById('time').innerHTML = "Server closed connection or hasn't been started";
        };
    </script>
</head>

<body style="margin: 0">
<noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript!
    WebSocket relies on Javascript being enabled. Please enable Javascript and reload this page!</h2></noscript>
<div id="time"
     style="position: absolute;
        bottom: 0;
        font-size: 800%;
        height: 200px;
        margin: auto;
        text-align: center;
        top: 0;
        width: 100%;">Starting...</div>
</body>
</html>
